package com.itheima.project.feign;

import com.itheima.project.basic.ResponseWrap;
import com.itheima.project.hystrix.TradingHystrix;
import com.itheima.project.vo.trade.RefundRecordVo;
import com.itheima.project.vo.trade.TradingVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * @ClassName TradingFace.java
 * @Description 交易Face接口
 */
@FeignClient(value = "module-trade-web",fallback = TradingHystrix.class )
public interface TradingFeign {


    /***
     * @description 按交易状态查询交易单
     * @param tradingState
     * @return
     */
    @GetMapping("trade/{tradingState}")
    ResponseWrap<List<TradingVo>> findTradingByTradingState(@PathVariable("tradingState") String tradingState);


    /***
     * @description 按交易状态查询退款记录
     * @param refundStatus
     * @return
     */
    @GetMapping("refundrecords/{refundStatus}")
    ResponseWrap<List<RefundRecordVo>> findReFundRecordByRefundStatus(@PathVariable("refundStatus") String refundStatus);
}
